<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <ul>
      <!-- <li v-for="item in list">{{item}}</li> -->
      <li v-for="(item, i) in list">{{item}}---{{i}}</li>
    </ul>

    <ul>
      <li v-for="item in arr">{{item.uname}}</li>
    </ul>

    <!--  渲染性能高 -->
    <ul>
      <!-- <li v-for="item in arr" v-bind:key="item.id">{{item.uname}}</li> -->
      <li v-for="(item, index) in arr" :key="item.id">{{item.uname}}---{{index}}</li>
    </ul>
  </div>
  <script src="./vue.js"></script>
  <script>
    // forEach index
    new Vue({
      el: '#app',
      data: {
        list: [
          'zs',
          'ls',
          'ww'
        ],
        arr: [
          {id: 1, uname: '张三'},
          {id: 2, uname: '李四'},
          {id: 3, uname: '王五'},
        ]
      }
    })
  </script>
</body>
</html>